<template>
  <van-nav-bar
    :title="route.params.name"
    left-text="返回"
    left-arrow
    @click-left="onClickLeft"
  >
  </van-nav-bar>
  <!-- //入院 -->
  <rytempt v-if="sortid=='AB'" :initialData="list"></rytempt>
  <!-- //其他 -->
  <cytempt v-if="sortid=='AE'" :initialData="list"></cytempt>
  <!-- //病程 -->
  <bctempt v-if="sortid=='AC'" :initialData="list"></bctempt>
</template>

<script setup>
import { useRoute, useRouter } from "vue-router";
import { reactive, ref, onMounted, computed } from "vue";
import { getemrcontent } from "../../api/emr";
import rytempt from "./component/rytempt.vue";
import bctempt from "./component/bctempt.vue";
import cytempt from "./component/cytempt.vue";
const router = useRouter();
const route = useRoute();

const selectitem = JSON.parse(localStorage.getItem("selectitem"));
const title = selectitem.name + selectitem.age + "岁";

const sortid = ref('') ;
sortid.value = route.params.sortid;
function onClickLeft() {
  //返回上一页
  router.back();
}
let list = ref();
getemrcontent({
  id: route.params.id,
}).then((res) => {
  if (res.code == 0) {
    list.value = res.data;
  } else {
    this.$toast.fail(res.msg);
  }
});
</script>

<style></style>
